<template>
  <div class="home">
	  <!-- 搜索栏 -->
	  <Sosuo></Sosuo>
	  <!-- 轮播图 -->
	  <Swiper :content="list"></Swiper>
	  <!-- 优质花材和吸顶 -->
	  <Pro></Pro>
	  <!-- 鲜花分类 -->
	  <Midnav></Midnav>
	  <!-- 快捷选择 -->
	  <Quick></Quick>
	  <!-- 热门商品 -->
	  <HotGo :hotgoods="goods"></HotGo>
	  <!-- 鲜花类型 -->
	  <Flower></Flower>
	  <!-- 公司 -->
	  <QueNav></QueNav>
	  <!-- 底部导航 -->
	  <BtmNavv></BtmNavv>
  </div>
</template>

<script>
// @ is an alias to /src
import Sosuo from './components/search.vue'
import Swiper from './components/swiper.vue'
import Pro from './components/Promise.vue'
import Midnav from './components/mid_nav.vue'
import Quick from './components/quickChoose.vue'
import HotGo from './components/hotGoods.vue'
import Flower from './components/flowers.vue'
import QueNav from '../../components/que_nav.vue'
// import BtmNavv from '../../components/btmNav.vue'
import axios from 'axios'

export default {
  name: 'Home',
  data(){
  	  return{
  		  list:[],
		  goods:[],
  	  }
  },
  components: {
	  Sosuo,Swiper,Pro,Midnav,Quick,HotGo,Flower,QueNav
  },
  
  async mounted() {
	  //为封装的axios来使用
 //  	axios.get('/api/banner/banner').then(res=>{
	// 	this.list=res.data
	// 	console.log(this.list)
	// })
	let result = await this.$http.get('/banner/banner')
	//打印获取的轮播图信息
	// console.log(result)
	this.list = result.data
	let goods = await this.$http.get('/goods/hot')
	// 打印热门商品信息
	// console.log(goods)
	this.goods = goods.data.data
	//打印token
	// console.log(this.$store.state.token,222222)
	//打印用户id
	// console.log(this.$store.state.u_id,33333)
  }
}
</script>
